package com.cskaoyan.javase.oop1._6bigexercise._0game;

/**
 * @description: 小练习
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

/**
 * > 完成以下案例，学会案例并且抽取出对象和响应的累
 * - 用面向对象的思想模拟LOL当中盖伦的战斗
 * - 用面向对象的思想模拟植物大战僵尸
 *
 * 怎么分析案例找到对象,然后抽象出类?
 * 盖伦这个英雄是对象 ---> 英雄类
 * 找到共性特征:
 *      属性: 名字,技能,血量
 *      行为: 攻击
 *
 */
public class Demo {
    public static void main(String[] args) {
        //创建盖伦的对象
        Legend hero = new Legend("盖伦", "致残打击", "勇气", "爱的魔力转圈圈", "大宝剑", 1000);
        hero.fight();

    }
}

class Legend {
    //属性
    String name;
    String skillQ;
    String skillW;
    String skillE;
    String skillR;
    int hp;

    //行为
    public String attack() {
        //System.out.println("人在塔在!");
        return "人在塔在!";
    }

    public Legend() {
    }

    public Legend(String name, String skillQ, String skillW, String skillE, String skillR, int hp) {
        this.name = name;
        this.skillQ = skillQ;
        this.skillW = skillW;
        this.skillE = skillE;
        this.skillR = skillR;
        this.hp = hp;
    }

    //战斗的方法
    public void fight() {
        System.out.println("名为:" + name + "的英雄使用" + skillR + attack());
    }
}


